import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository, getConnection } from 'typeorm';

@Injectable()
export class HomeDao {

    public connection = getConnection();
    constructor(
    ) { }

    /**
 * 查看设备总数
 */
    getBusiness(params: any) {
        let sql = "select * from business";
        return this.connection.query(sql);
    }

    /**
     * 查看设备总数
     */
    getCounts(params: any) {
        let sql = "select count(*) from lighting";
        return this.connection.query(sql);
    }

    /**
    * 查询灯杆网关
    */
    getGateWay(params: any) {
        const sql = "select * from gateway";
        return this.connection.query(sql);
    }


}
